<?php /* Smarty version 2.6.13, created on 2013-10-08 08:54:37
         compiled from Index/shoppingcar.html */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Coming Eating-我的商品</title>
<link rel="shortcut icon" href="Tpl/hotel.ico"/>
<!-- href属性中的路径要相对主文件定位，否则会加载不到 -->
<link rel="stylesheet" type="text/css" href="Public/Css/Base.css"/>
<link rel="stylesheet" type="text/css" href="Public/Css/shoppingcar.css"/>
<link rel="stylesheet" type="text/css" href="Public/Css/position.css"/>
<link rel="stylesheet" type="text/css" href="Public/Css/nav.css"/>

<script type="text/javascript" src="Public/Js/jquery.js"></script>
<script type="text/javascript" src="Public/Js/main.js"></script>
<script type="text/javascript" src="Public/Js/lightbox.min.js"></script>
<script type="text/javascript">
		$(document).ready(function() {
			$('#main_nav').allenMenu();
			$('#slide').allenSlide();
			$('a[name=need_lightbox]').lightBox();
		});
		function ChangeNum(food_name,food_id){
			
			var Value = $("[name='"+food_name+"']").val();
			$.ajax({
				type:'get',
				url:"AddToCar.php?flag=changenum",
				data:"food_id="+food_id+"&food_num="+Value,
				dataType:'text',
				success:function(e){
					if(e){
						//这里要讲总价格写上去
						$("#priceTotal").text(e);
					}else{
						$("#priceTotal").text(e);
					}
				}
				
			});
		}

</script>

</head>
<body >

<!-- 这个地方用一个标志  确定是否显示这个 -->
<?php if ($_SESSION['loginFlag'] == 0): ?>
	
	<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'Public/hide.html', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php endif; ?>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'Public/indexheader.html', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'Public/search.html', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'Public/position.html', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<div id="tableData">
	<div id="carTable">
	<form action="Order.php?flag=display" method='post'>
		<table >
			<tr><th>商品编号</th><th>商品名称</th><th>商品样式</th><th>会员价格</th><th>价格</th><th>购买数量</th><th>操作</th></tr>
			<?php $_from = $this->_tpl_vars['buyNowRes']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['v']):
?>
			<tr>
			<td><?php echo $this->_tpl_vars['v']['food_id']; ?>
</td>
			<td><a href="FoodDetail.php?food_id=<?php echo $this->_tpl_vars['v']['food_id']; ?>
"><?php echo $this->_tpl_vars['v']['food_name']; ?>
</td>
			<td><img id="foodpic" src='Admin/Upload/<?php echo $this->_tpl_vars['v']['food_pic']; ?>
'/></td>
			<td><?php echo $this->_tpl_vars['v']['food_userprice']; ?>
元</td>
			<td><?php echo $this->_tpl_vars['v']['food_singleprice']; ?>
元</td>
			
						<td><input type="text" name='changenum<?php echo $this->_tpl_vars['v']['food_id']; ?>
' id="<?php echo $this->_tpl_vars['v']['food_id']; ?>
" value="<?php echo $this->_tpl_vars['v']['food_num']; ?>
" size='2' onchange="ChangeNum(this.name,this.id)"/>个</td>
			<td><a href='AddToCar.php?flag=deletfromcar&food_id=<?php echo $this->_tpl_vars['v']['food_id']; ?>
'>[删除]</a></td>
			</tr>
			
			<?php endforeach; else: ?>
			<tr><td colspan='7'>您还没有商品信息!</td></tr>
			<?php endif; unset($_from); ?>
			<tr><td colspan='5'><input type='hidden' name='totalPrice' value='<?php echo $this->_tpl_vars['totalPrice']; ?>
'/></td><td id='pricewidth'>合计：<font id="priceTotal"><?php echo $this->_tpl_vars['totalPrice']; ?>
</font>元</td><td style="width:125px" colspan='2'><input type="image" src="Public/Images/orderConfirm.jpg"/></td></tr>
		</table>
	</form>
	</div>

</div>
	


<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'Public/footer.html', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
</body>
</html>